#ifndef HOME_VIEW_H
#define HOME_VIEW_H

#include <QDialog>
#include <QPushButton>

#include "view_base.h"
#include "result_processor.h"
#include "data_types.h"

namespace Ui {
    class HomeView;
}

class QListWidgetItem;
class ActivityView;

class HomeView : public ViewBase, ResultProcessor
{
    Q_OBJECT

public:
    explicit HomeView(QWidget *parent = 0);
    virtual ~HomeView();

    virtual void IssueRequest();

  protected:
    virtual int ProcessResult(RequestMethod &r, QDomElement &e);

public slots:
    void showActivity(QListWidgetItem *item);

private:
    int parse_result(QDomElement &e);
    int parse_activities(QDomElement &e);
    int parse_place_tags(QDomElement &e);
    int parse_activity_tags(QDomElement &e);

private:
    Ui::HomeView *ui;

    QVector<activity> homeActivities;
    QVector<tag> placeTags;
    QVector<tag> activityTags;

    QPushButton *btnPlaceTags[8];
    QPushButton *btnActivityTags[8];

    ActivityView *activityView_;
};

#endif // HOME_VIEW_H
